package com.hs.dynamic.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hs.dynamic.entity.UserDriver;
import com.hs.dynamic.mapper.UserDriverMapper;
import com.hs.dynamic.service.UserDriverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description: TODO
 * @Author 胡尚
 * @Date: 2024/8/2 15:25
 */
@Service
public class UserDriverServiceImpl extends ServiceImpl<UserDriverMapper, UserDriver> implements UserDriverService {

    @Autowired
    private UserDriverMapper userDriverMapper;

    @Override
    public UserDriver getByUserId(Long userId) {
        LambdaQueryWrapper<UserDriver> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(UserDriver::getUserId, userId);
        return userDriverMapper.selectOne(queryWrapper);
    }
}
